<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
	<meta name="decorator" content="moduleEdit" />
	<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
	<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
	<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
	<script type="text/javascript" src="${staticPath}/js/brand.js"></script>
	<script type="text/javascript">
		$(function(){
			$("#brandReviewForm").validate({
				rules: {
					brandLevelId:{
						 required:true
					 }
				 },
				submitHandler: function(form){
					Oosp_Loading('正在提交，请稍等...');
					returnCheckedNos();
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
			showShopList();
		});
		
		function openWin(url)
		{
			var returnValue = openTempleteSelector(url,600,550);
			$("#brandCateId").val(returnValue.brandCateId);
			$("#brandNo").val(returnValue.brandNo);
			$("#brandInfo").val(returnValue.brandInfo);
		}
		
		function showShopList()
		{
			var id = $("#id").val();
			if(null == id || id.length < 1){
				id = "ALL";
			}
			loadShopData('/biz/brand/brandreview/'+id+'/getShopList');
		}
	</script>
</head>
<body>
<div class="Report_f">
           <div class="Report_f_1">
                <div class="Report_f_title_1">新增评审记录</div>
                <ul class="nav nav-tabs Report_f_title_2">
                    <li><a href="#label_1" data-toggle="tab">基本信息</a></li>
                    <li><a href="#workflow" data-toggle="tab">流程审批 </a></li> 
			  		<li><a href="#diagram" data-toggle="tab">流程图</a></li>
                  </ul>
<!-- Tab panes -->
                  <div class="tab-content Report_f_title_3">
                    <div class="tab-pane active" id="label_1">
                        <div class="Report_f_title_4">
                         <form:form id="brandReviewForm" modelAttribute="brandReview" action="${contextPath}/biz/brand/brandreview/submit" method="post" class="form-inline" role="form">
                         <form:hidden path="id" id="id"/>
                         <form:hidden id="brandCateId" path="brandCateId"/>
                         <form:hidden path="checkinShopNos" id="checkinShopNos"/>
                         <input type="hidden" id="navId" name="navId" value="${navId }"/>
						<tags:message content="${message}"/>
                         <div class="f_2">
								<div class="form-group col-sm-6">
									<label for="brandInfo" class="col-sm-3 control-label f_4">品牌:</label>
									<div class="col-sm-9 f_6">
										 <div class="input-group">
											 <c:choose>
												<c:when test="${brandReview.id != null}">
													<input id="brandInfo" name="brandInfo" value="${brandReview.brandCname}(${brandReview.brandNo})/${brandReview.cateName}" readonly="readonly" class="f_5 required"/>
												</c:when>
												<c:otherwise>
													<input id="brandInfo" name="brandInfo" readonly="readonly" class="f_5 required"/>
												</c:otherwise>
											</c:choose>
											<span class="input-group-btn">
												<a class="btn btn-default btn_3" href="#" onclick="openWin('${contextPath}/biz/brand/brandcate/dialoglist')">选择</a>
											</span>
									    </div>
									</div>
								</div>
                          </div>
                          <div class="f_2">
                          		<div class="form-group col-sm-6">
	                                   <label for="reviewNo" class="col-sm-3 control-label f_4">评审编号:</label>
	                                   <div class="col-sm-9 f_6">
	                                  	 <form:input id="reviewNo" path="reviewNo" maxlength="30" class="f_5 required"/>
	                                   </div>
								</div>
								<div class="form-group col-sm-6">
									<label for="reviewDate" class="col-sm-3 control-label f_4">评审日期:</label>
									<div class="col-sm-9 f_6">
										 <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" >
											<input id="reviewDate" readonly="readonly" name="reviewDate" type="text"  class="form-control f_13 required"
												value="<fmt:formatDate value="${brandReview.reviewDate}" pattern="yyyy-MM-dd"/>"/>
											<span class="input-group-addon f_time"><span class="glyphicon glyphicon-remove"></span></span>
							                 <span class="input-group-addon f_time"><span class="glyphicon glyphicon-calendar"></span></span>
						                 </div>
									</div>
								</div>
                          </div>
                          <div class="f_2">
                          		<div class="form-group col-sm-6">
	                                   <label for="brandLevelId" class="col-sm-3 control-label f_4">品牌等级:</label>
	                                   <div class="col-sm-9 f_6">
	                                   		<ossp:select dictType=""  service="selectBrandLevelDataService?levelType=1" value="${brandReview.brandLevelId }" name="brandLevelId" id="brandLevelId" class_="f_5 required"></ossp:select>
	                                   </div>
								</div>
								<div class="form-group col-sm-6">
									<label for="reporter" class="col-sm-3 control-label f_4">引进品牌责任人:</label>
									<div class="col-sm-9 f_6">
										<form:hidden path="personLiable"/> 
										<div class="input-group">
										 <input type="text" class="f_5 required" id="personLiable_name" name="personLiable_name" value="${brandReview.personLiable }" readonly="readonly">
									      <span class="input-group-btn">
									        <button class="btn btn-default btn_3" id="p_userDialogMultiple" data-dialog="dialog" data-multiple='true' data-idField="personLiable" data-nameField="personLiable_name" data-authType="USER" type="button">
									        	选择
									        </button>
									      </span>
									    </div>
										</div>
								</div>
                          </div>
                           <div class="f_2">
								<div class="form-group col-sm-6">
									<label for="isStorage" class="col-sm-3 control-label f_4">是否入库:</label>
									<div class="col-sm-9 f_6">
				    					<ossp:radio dictType="YESORNO" defaultChecked="0" value="${brandReview.isStorage }" name="isStorage"id="isStorage"></ossp:radio>
									</div>
								</div>
								<div class="form-group col-sm-6">
	                                   <label for="isTargetBrand" class="col-sm-3 control-label f_4">是否目标战略品牌:</label>
	                                   <div class="col-sm-9 f_6">
						    			<ossp:radio dictType="YESORNO" defaultChecked="0" value="${brandReview.isTargetBrand }" name="isTargetBrand"id="isTargetBrand"></ossp:radio>
	                                   </div>
								</div>
                          </div>
                          <div class="f_2">
		                      <div class="form-group col-xs-12">
								<label for="checkShop" class="col-lb-1 control-label f_10">可合作门店:</label>
								<div class="col-sm-10 col-lb-2 f_6">
									<table id="shopData" class="table table-bordered" >
									</table>
								</div>
							 </div>
						  </div>
						  <div class="f_3">
			                      <div class="form-group col-xs-12">
									<label for="reviewResult" class="col-lb-1 control-label f_10">评审结论:</label>
									<div class="col-sm-10 col-lb-2 f_6">
										<form:textarea id="reviewResult" path="reviewResult" class="form-control f_11"  maxlength="300"/>
									</div>
								 </div>
							</div>
							 <div class="f_12">
                                   <button type="button" class="btn btn-danger btn_5 btn_right" onclick="history.go(-1)">返&nbsp;回</button>
                                   <button type="submit" class="btn btn-success btn_5 btn_right">提&nbsp;交</button>
                              </div>
                         </form:form>
              </div>
		  </div>
		  
				<div class="tab-pane" id="workflow"> 
				<form id="brandCateWorkFlowForm" action="${contextPath}/biz/brand/brandreview/submit" method="post">
				<input type="hidden" id='id' name="id" value="${brandReview.id}"  >
						<c:import url="/WEB-INF/views/bpm/workflow/workFlowInfo_edit.jsp">
								<c:param name="formName" value="com.maoye.ossp.biz.brand.entity.BrandReview" />
							<c:param name="flowKey" value="IBrandReview" />
							<c:param name="businessId" value="${brandReview.id}"/>
							<c:param name="method" value="${method}"/>
							<c:param name="isStart" value="${isStart}"/>
						</c:import> 
						 <div class="f_12">
					     <button type="submit" id="save" class="btn btn-success btn_5 btn_right">提交</button>
					   </div>
						</form>			
					</div>
				<div class="tab-pane" id="diagram" style="overflow-x:auto;">
					<iframe id="diagram_iframe" scrolling="no" frameborder=0 width="100%">
					</iframe>
				</div>
		</div>	
	</div>
</div>
<script type="text/javascript" src="${staticPath}/js/list.js"></script>
	<script type="text/javascript">
	$('.form_date').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd',
		pickerPosition: "bottom-left"
    });
</script>
</body>
</html>